package com.dify.tool.controller;


import com.dify.tool.api.dto.AgentManageDTO;
import com.dify.tool.api.vo.AgentStatisticsVO;
import com.dify.tool.common.model.DefaultResponse;
import com.dify.tool.service.IAgentManageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 智能体监测相关接口 前端控制器
 * </p>
 *
 * @author shl
 * @since 2025-05-30
 */
@Slf4j
@RestController
@RequestMapping("/agentManage")
@Tag(description = "agentManage", name = "智能体监测相关接口")
public class AgentManageController {

    @Resource
    private IAgentManageService iAgentManageService;


    /**
     * 会话统计
     */
    @GetMapping("/conversationsStatistics")
    @Operation(summary = "会话统计")
    public DefaultResponse<List<AgentStatisticsVO>> conversationsStatistics(@ParameterObject AgentManageDTO query) {
        return DefaultResponse.success(iAgentManageService.conversationsStatistics(query));
    }


    /**
     * 活跃用户统计
     */
    @GetMapping("/terminalStatistics")
    @Operation(summary = "活跃用户统计")
    public DefaultResponse<List<AgentStatisticsVO>> terminalStatistics(@ParameterObject AgentManageDTO query) {
        return DefaultResponse.success(iAgentManageService.terminalStatistics(query));
    }


    /**
     * 用户满意度统计
     */
    @GetMapping("/satisfyStatistics")
    @Operation(summary = "用户满意度统计")
    public DefaultResponse<List<AgentStatisticsVO>> satisfyStatistics(@ParameterObject AgentManageDTO query) {
        return DefaultResponse.success(iAgentManageService.satisfyStatistics(query));
    }


    /**
     * 全部消息数
     */
    @GetMapping("/messageStatistics")
    @Operation(summary = "全部消息数")
    public DefaultResponse<List<AgentStatisticsVO>> messageStatistics(@ParameterObject AgentManageDTO query) {
        return DefaultResponse.success(iAgentManageService.messageStatistics(query));
    }

}
